<?php

include "../lib/start.php";

check_session();
check_permission(ADM_PERM);

$action = "insert";
if(isset($_REQUEST['do']))
	$action = $_REQUEST['do'];

$sel_anno = "SELECT * FROM anni ORDER BY id_anno DESC LIMIT 1";
$res_anno = $db->executeQuery($sel_anno);
$year = new AnnoScolastico($res_anno->fetch_assoc());

if($action == update){
	$hol = array();
	foreach($year->get_holydays() as $a){
		$month = substr($a, 5, 2);
		if(!isset($hol[$month]))
			$hol[$month] = array();
		array_push($hol[$month], $a);
	}
}

include "new_year.html.php";

?>